unit Unit5;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ExtCtrls, Mask, DBCtrls;

type
  TForm5 = class(TForm)
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    BitBtn1: TBitBtn;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit4: TEdit;
    Edit3: TEdit;
    BitBtn2: TBitBtn;
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure Edit1Change(Sender: TObject);
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form5: TForm5;
  Present, A:TDateTime;
  YearP,MonthP,DayP:word;

implementation

uses Unit4, Unit3, Unit2, Unit1;

{$R *.dfm}

procedure TForm5.BitBtn1Click(Sender: TObject);
begin
DataModule4.reg.ParamByName('P1').AsString:=Edit1.Text;
DataModule4.reg.ParamByName('P2').AsString:=Edit2.Text;
DataModule4.reg.ParamByName('P3').AsString:=Edit3.Text;
DataModule4.reg.ParamByName('P4').AsString:=Edit4.Text;
DataModule4.reg.ExecSQL;
Form5.Close;
end;

procedure TForm5.BitBtn2Click(Sender: TObject);
begin
Form5.Close;
end;

procedure TForm5.Edit1Change(Sender: TObject);
begin
if (Edit1.Text<>'') and (Edit2.Text<>'')
and (Edit3.Text<>'') and (Edit4.Text<>'')
then BitBtn1.Enabled:=true
else
BitBtn1.Enabled:=false;
end;

procedure TForm5.FormActivate(Sender: TObject);
begin
BitBtn1.Enabled:=false;
Present:=Now;
Decodedate(Present,YearP,MonthP,DayP);
Edit4.Text:=Datetostr(Present);
end;

end.
